#ifndef __CLIENT_H__
# define __CLIENT_H__

#include <iostream>
//#include "winsock2.h"
#include "Connection.h"
#include "IBuffer.h"
#include "Empacter.h"
#include "IMutex.h"
#include "IEvent.h"

class Client
{
public:
	Client(int id, Network::Connection* cnt);
	~Client();
	int						GetId();
	Network::Connection*	GetConnection();
	IBuffer*				GetBuffer();
	unsigned int			SendBuffer(void* data, unsigned int size);
	static void				SendData(void* client);

private:
	int						_id;
	Network::Connection*	_cnt;
	unsigned int			_availableToSend;
	bool					_sendLoop;
	IBuffer*				_buff;
	IBuffer*				_buffSend;
	IMutex*					_lockSend;
	IEvent*					_eventBuffer;
	IEvent*					_eventDestructor;
};

#endif